import 'package:json_annotation/json_annotation.dart';

part 'page_meta.g.dart';

@JsonSerializable()
class PageMeta {
  @JsonKey(name: 'offset')
  int offset;

  @JsonKey(name: 'current_page')
  int currentPage;

  @JsonKey(name: 'page_size')
  int pageSize;

  @JsonKey(name: 'first_page')
  int firstPage;

  @JsonKey(name: 'last_page')
  int lastPage;

  @JsonKey(name: 'total_records')
  int totalCount;

  PageMeta({
    required this.offset,
    required this.currentPage,
    required this.pageSize,
    required this.firstPage,
    required this.lastPage,
    required this.totalCount,
  });

  factory PageMeta.fromJson(Map<String, dynamic> json) =>
      _$PageMetaFromJson(json);
  Map<String, dynamic> toJson() => _$PageMetaToJson(this);
}
